//
//  NSString+Config.m
//  分享demo
//
//  Created by pc-chtypd056 on 2018/8/24.
//  Copyright © 2018年 CTL. All rights reserved.
//

#import "NSString+Config.h"

@implementation NSString (Config)

- (CGSize)sizeWithFont:(UIFont *)font maxsize:(CGSize)size{
    NSDictionary *dic = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
    CGRect rect = [self boundingRectWithSize:size options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    return rect.size;
}

@end
